Home:ALL Converter>Vscode C++ debugging by bash script

Vscode C++ debugging by bash script

Ask Time:2020-11-23T19:10:36         Author:tShalti

Json Formatter

I want to debug a C++ program with VSCode, but I run my program with a bash script. I tried this:

    {
        "name": "Run",
        "type": "cppdbg",
        "request": "launch",
        "program": "/bin/bash",
        "stopAtEntry": false,
        "args": ["-ic" , "run_script"],
    },

But I receive

bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell

And the debugger doesn't connect (though the program is running). I know there's tasks.json for scripts but I want to debug the C++ program invoked from the script. Is it possible?

Author:tShalti,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/64967294/vscode-c-debugging-by-bash-script
yy